package com.lili.model.operate;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.ibatis.javassist.SerialVersionUID;

import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("li_message")
//先不进行序列化行不行
public class IMessage {

    private static final long SerialVersionUID = 1L;
    @TableId(value = "id",type = IdType.ASSIGN_ID)
    Long id;

    String createBy;

    @TableField(fill = FieldFill.INSERT)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    LocalDateTime createTime;

    @TableLogic(value = "false", delval = "true")
    Byte deleteFlag;

    String updateBy;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    LocalDateTime updateTime;

    String content;//内容

    String messageRange; //发送范围

    String title; //标题

    Byte createSend; //创建发送

    String type; //类型

    String messageClient;//发送客户端
}
